<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('回复信件工单')"/>
    <style>
        label {
            font-weight: bold;
        }

        @font-face {
            font-family: 'huawen';
            src: url("/fonts/huawen.woff2");
        }
    </style>
</head>

<body style="background-color: #F4F6FA;font-size: 13px;font-family:'huawen' ;font-weight: bold">
<iframe id="showWorkForm" width="100%" scrolling="no" th:src="@{'/system/mMailWF/cmnFile/showWorkForm/'+${wfId}}" frameborder="0" seamless></iframe>
<div class="main-content" style="margin: 0;padding: 0">

    <form id="form-user-add" class="form-horizontal" style="background-color: #F4F6FA">

        <div class="col-sm-12" style="display: flex">
            <div class="entering-page" style="overflow:hidden;width:49%;">
                <!--    回复电话工单    -->
                <div class="col-sm-12 tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px">回复信件工单 <a th:if="${ySpare != null && #strings.length(ySpare) > 10}" class="btn btn-sm btn-primary" onclick="lookImage(this)">查看图片</a></h4>
                </div>
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-2 control-label entering-pd" style="color: red">回复内容:</br>(供主办单位参考):</label>
                        <div class="col-sm-10">
                            <textarea id="backDesc" name="taBackDesc" maxlength="3500"
                                      class="form-control"
                                      cols="100"
                                      rows="7" required="required"></textarea>
                        </div>
                    </div>
                </div>
                <!--按钮-->
                <div class="col-sm-12" style="display: flex;justify-content:center;margin:15px 0px 15px 0px">
                    <div class="form-group">
                        <div class="col-sm-3" style="display: flex;justify-content: space-evenly;">
                            <button type="button" class="btn btn-sm btn-success" onclick="sub()">回复</button>&nbsp;&nbsp;&nbsp;&nbsp;
                            <button type="button" class="btn btn-sm btn-light" onclick="parent.closeItem()">关闭</button>
                        </div>
                    </div>
                </div>
            </div>
            <div th:each="sons,stat: ${sonBackList}" style="overflow:hidden;width:25%;">
                <div class="col-xs-12 pd2" th:if="${son != null}" th:unless="${#lists.isEmpty(sonBackList)}"  th:each="son,stat: ${sons}">
                    <div class="ibox">
                        <div class="ibox-title">[[${son.sbdeptName}]]</div>
                        <div class="ibox-content">
                            <p>交办次序：[[${son.seqName}]] <a th:unless="${#strings.isEmpty(son.backDesc)}" style="float: right;" class="btn btn-outline btn-primary copyBtn" onclick="copyBackDesc(this);return false;">复制</a></p>
                            <p>办理性质：[[${son.sortName}]]</p>
                            <p>执行处(科)室：[[${son.bdutyDept}]]</p>
                            <p>回复人：[[${son.buserName}]]</p>
                            <p>联系电话：[[${son.bdutyTel}]]</p>
                            <p>回复时间：[[${#dates.format(son.backTime,'yyyy-MM-dd HH:mm:ss')}]]</p>
                            <p><span>回复内容：</span><span class="replyContent">[[${son.backDesc}]]</span></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<input type="hidden" id="ySpare" name="ySpare" th:value="${ySpare}" />
<input type="hidden" id="pkId" name="pkId" th:value="${wfId}" />
<input type="hidden" id="wsCode" name="wsCode" th:value="${wsCode}" />
<th:block th:include="include :: footer"/>
<script>
    var prefix = ctx + "system/mMailWF";

    $("#showWorkForm").on("load",function(){//iframe加载完后 高度自适应。
        var showWorkForm = document.getElementById("showWorkForm").contentDocument || document.getElementById("showWorkForm").contentWindow.document,
            mainWrapHeight = $(window).height() - 49 - 21,
            frame_height = showWorkForm.documentElement.scrollHeight;
        $("#showWorkForm").height( frame_height < 305 ? mainWrapHeight : frame_height);
    });

    function sub(){
        //回复内容不能为空
        if($("#backDesc").val().length<1){
            parent.$.modal.alertWarning("回复内容不能为空");
            return false;
        }

        if ($.validate.form()) {
            let url = prefix + "/cmnFile/mailReplyWllz/"+$("#pkId").val();
            let data = $('#form-user-add').serializeArray();
            parent.$.operate.saveTab(url,data);
        }
    }
</script>
</body>
</html>

